package cate.game.role.farm.adventure.task.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBAdventure;
import easy.java.dev.note.NoteField;

import java.util.List;


@ClientMsg(title = "接受探险任务 の 请求")
public class AcceptTaskReq implements MsgInput {
    @NoteField("任务uid")
    public String taskUid;

    @NoteField("做任务的英雄uid")
    public List<String> heroIds;
    
    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getFarm().adventure.task.acceptTask(taskUid, heroIds);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBAdventure.ACCEPT_TASK_REQ;
    }
}
